<?php

// require_once('include.php');
session_start();

//dev testing purposes
$_SESSION['username'] = 'aMarciniak';
$_SESSION['userName'] = 'aMarciniak';
$_SESSION['userPassHash'] = 'aMarciniak';
$_SESSION['password'] = 'aMarciniak';
$_SESSION['logged-in'] = true;
require_once 'paradigmShift/_paradigmShift.php';
$userName = $_SESSION['userName'];
$userPassHash = $_SESSION['userPassHash'];

if(!isset($_SESSION['logged-in'])){
  header("location:index.php");
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>7 Paradigms Template</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <!-- Le styles -->
  <link href="css/bootstrap.css" rel="stylesheet">
  <style type="text/css">
  body {
    padding-top: 60px;
    padding-bottom: 40px;
  }
  .sidebar-nav {
    padding: 9px 0;
  }
  </style>
  <link href="css/bootstrap-responsive.css" rel="stylesheet">
  <link href="css/datepicker.css" rel="stylesheet">

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
      <![endif]-->

      <!-- Fav and touch icons -->
      <link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
      <link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
      <link rel="shortcut icon" href="ico/favicon.png">


    </head>

    <body>
      <form action="">
      <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
          <div class="container-fluid">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </a>
            <a class="brand" href="#">7 Paradigms Template</a>
            <div class="nav-collapse collapse">
              <p class="navbar-text pull-right">
                Logged in as <a href="#" class="navbar-link"><?php echo $_SESSION['username'];?></a>
              </p>
              <ul class="nav">
                <li><input class="btn" type="submit" name="mainPanel" value="Home" /></li>
                <!-- <li class="active"><a type="submit" href="main_hero.php">Home</a></li> -->
                <!-- <li><a href="#about">About</a></li>
                <li><a href="#contact">Contact</a></li> -->
              </ul>
            </div><!--/.nav-collapse -->
          </div>
        </div>
      </div>
    </form>
      <div class="container-fluid">
        <div class="row-fluid">
          <div class="span2 left-nav">
            <div class="well sidebar-nav">
              <form action="">
              <ul class="nav nav-list">
                <li class="nav-header">Employee</li>
                <li><input class="btn-link" type="submit" name="mainPanel" value="Upcoming" /></li>
                <li><input class="btn-link" type="submit" name="mainPanel" value="History" /></li>
                <li><input class="btn-link" type="submit" name="mainPanel" value="Profile" /></li>
                <li><input class="btn-link" type="submit" name="mainPanel" value="Shift Shop" /></li>
                <li class="nav-header">Manager</li>
                <li> <input class="btn-link" type="submit" name="mainPanel" value="Employee Manager" /></li>
                <li> <input class="btn-link" type="submit" name="mainPanel" value="Manager Manager" /></li>
                <li> <input class="btn-link" type="submit" name="mainPanel" value="Shift Manager" /></li>
                <li> <input class="btn-link" type="submit" name="mainPanel" value="Pending Requests" /></li>
                <li> <input class="btn-link" type="submit" name="mainPanel" value="Add New Shift" /></li>
                <li> <input class="btn-link" type="submit" name="mainPanel" value="Add New Account" /></li>
                <li> <input class="btn-link" type="submit" name="mainPanel" value="Employee Shifts" /></li>
              </ul>
            </form>
            </div><!--/.well -->
          </div><!--/span-->
          <div id="mainContent" class="span9">
            <h1>
              <?php
              if (!isset($_GET['mainPanel'])){
                echo "";
              }
              else if($_GET['mainPanel'] === "Home"){
                echo "";
              }
              else 
                echo $_GET['mainPanel'];
              ?>
            </h1>
            <hr/>
            <?php

              $mainPanel;
              if (isset ($_GET['mainPanel']))
              {
                $mainPanel = $_GET['mainPanel'];
                $_SESSION['mainPanel'] = $mainPanel;
              }
              elseif (isset ($_SESSION['mainPanel']))
              {
                $mainPanel = $_SESSION['mainPanel'];
              }
              else
              {
                $mainPanel = "Hero";
              }

              switch ($mainPanel) {
                case "Employee Shifts":
                    include_once "viewEmpShifts.php";
                    break;
                case "Add New Account":
                    include_once "main_addAccount.php";
                    break;
                case "Add New Shift":
                    include_once "main_addShift.php";
                    break;
                case "Pending Requests":
                    include_once "main_pendingRequests.php";
                    break;
                case "Shift Manager":
                    include_once "main_shiftManager.php";
                    break;
                case "Manager Manager":
                    include_once "main_updateManagers.php";
                    break;
                case "Employee Manager":
                    include_once "main_empManager.php";
                    break;
                case "Shift Shop":
                    include_once "main_shop.php";
                    break;
                case "Profile":
                    include_once "main_profile.php";
                    break;
                case "History":
                    include_once "main_history.php";
                    break;
                case "Hero":
                    include_once "main_hero.php";
                    break;    
                case "Upcoming":
                    include_once "main_upcoming.php";
                    break;
                default:
                    include_once "main_hero.php";
                    break;
            }
            ?>
          </div><!--/span-->
        </div><!--row-->
        <hr>

        <footer class="footer">
          <p class="pull-right">&copy;7 Paradigm Co. 2013</p>
      </footer>

    </div><!--/.fluid-container-->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/bootstrap-transition.js"></script>
    <script src="js/bootstrap-alert.js"></script>
    <script src="js/bootstrap-modal.js"></script>
    <script src="js/bootstrap-dropdown.js"></script>
    <script src="js/bootstrap-scrollspy.js"></script>
    <script src="js/bootstrap-tab.js"></script>
    <script src="js/bootstrap-tooltip.js"></script>
    <script src="js/bootstrap-popover.js"></script>
    <script src="js/bootstrap-button.js"></script>
    <script src="js/bootstrap-collapse.js"></script>
    <script src="js/bootstrap-typeahead.js"></script>
    <script src="js/bootstrap-datepicker.js"></script>
    <script>
      $('.datepicker').datepicker({
        format: 'yyyy-mm-dd'
      });
    </script>


  </body>
  </html>